﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Cephei.QL
{
    /// <summary>
    /// Provides an interface to set the evaluation date for Quantlibs rather stupid implementation!
    /// </summary>
    public interface ISession
    {
        /// <summary>
        /// get and set the evaluation date to be used on this thread
        /// </summary>
        DateTime EvaluationDate { get; set; }

        /// <summary>
        /// Evaluate the object in the context of the evaluaiton  date
        /// </summary>
        /// <example>
        /// session.With&ltInstrument&gt (instr, DateTime(2011,6 27)).NPV</Instrument>
        /// </example>
        /// <typeparam name="T">type of the object passed through</typeparam>
        /// <param name="t">the value to pass through</param>
        /// <param name="evaluationDate">the date that should be set</param>
        /// <returns>t unaltered </returns>
        T With<T> (T t, DateTime evaluationDate);
    }

    public interface ISession_Factory
    {
        ISession Create ();
        ISession Create (DateTime effectiveDate);
    }
}
